package com.glory.wxelectricitypda.fragment;


import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.glory.wxelectricitypda.R;
import com.glory.wxelectricitypda.adapter.UnpackagedAdapter;
import com.glory.wxelectricitypda.bean.BoxLabelReviewBean;
import com.pda.platform.ui.ui_pdaplatform.base.FreeUI_BaseFragment;
import com.pda.platform.ui.ui_pdaplatform.entity.FreeUI_AddViewEntity;

import butterknife.BindView;


public class PDAPackingFragment extends FreeUI_BaseFragment {

    @BindView(R.id.unpackagedRecycler)
    RecyclerView unpackagedRecycler;
    public UnpackagedAdapter mUnpackagedAdapter;

    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_p_d_a_packing;
    }

    @Override
    protected void initView() {

        unpackagedRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
        unpackagedRecycler.setItemAnimator(new DefaultItemAnimator());
        unpackagedRecycler.addItemDecoration(new DividerItemDecoration(getActivity(), 1));
        mUnpackagedAdapter = new UnpackagedAdapter(null);
        mUnpackagedAdapter.openLoadAnimation(BaseQuickAdapter.ALPHAIN);
        mUnpackagedAdapter.isFirstOnly(true);
        unpackagedRecycler.setAdapter(mUnpackagedAdapter);
    }

    @Override
    protected void initData() {

    }

    public void addData(BoxLabelReviewBean.XPACKAGEDETAILDTO packBean){
        mUnpackagedAdapter.addData(packBean);
    }

    @Override
    protected FreeUI_AddViewEntity getBaseEntity() {
        return null;
    }
}